package study.javaee.practice.common.exception;


import study.javaee.practice.common.api.ApiErrorCode;
import study.javaee.practice.common.api.ResultCode;

/**
 * 用户抛出业务异常
 */
public class Throws {
    /**
     * 默认使用CLIENT_FAILED
     */

    public static void clientFailed(String message){
        throw new ApiException(ResultCode.CLIENT_FAILED, message);
    }

    public static void failed(ApiErrorCode errorCode){
        throw new ApiException(errorCode);
    }

    public static void failed(ApiErrorCode code, String message){
        throw new ApiException(code, message);
    }
}
